package main

import "fmt"

var G_ID uint64 = 0
var Map_Objects map[uint64]interface{} = nil

type Object interface {
	id() uint64
}
type BaseObject struct {
	m_id uint64
}

func (o *BaseObject) id() uint64 {
	return o.m_id
}

func NewID() uint64 {
	G_ID = G_ID + 1
	return G_ID - 1
}

func NewObject() *BaseObject {
	obj := &BaseObject{}
	obj.m_id = NewID()

	if Map_Objects == nil {
		Map_Objects = make(map[uint64]interface{})
	}
	fmt.Println("ID:", obj.m_id)
	Map_Objects[obj.m_id] = obj

	return obj
}
